Skip to content

Add program requirements parsing and optional-course shelf (backend + frontend)#21

Open
an-andrey wants to merge 24 commits into
mainfrom
codex/optimize-scraping-for-mcgill-course-site-on4lz6
Open

Add program requirements parsing and optional-course shelf (backend + frontend)#21
an-andrey wants to merge 24 commits into
mainfrom
codex/optimize-scraping-for-mcgill-course-site-on4lz6

Conversation

@an-andrey

Copy link
Copy Markdown
Owner

Motivation

  • Extract structured program requirement buckets from program pages and persist them in session so requirement-aware features can be displayed and merged when adding multiple programs.
  • Provide a UI to surface optional/complementary courses so users can add/remove non-required courses to their graph without losing core-only defaults.
  • Provide robust fallbacks for missing course metadata when a course is not found in static/json/courses_info.json.

Description

  • Add a new parser scripts/Getting_Info_For_Major/program_requirements.py that extracts requirement buckets, maps courses to buckets, and computes credit totals, and return a requirements object via extract_program_requirements.
  • Improve scraping in scripts/Getting_Info_For_Major/get_courses_of_major.py by introducing get_program_soup, a regex-based course code extractor, and get_course_metadata_from_program_page fallback metadata extraction.
  • Update scripts/Getting_Info_For_Major/get_information_for_major.py to call the new requirement extractor and return (prereqs, details, requirements) and annotate course details with bucket/category/credits/include flags.
  • Add backend helpers in app.py: rebuild_requirements_from_details to synthesize requirements from details and merge_program_requirements to combine multiple program buckets, and persist program_requirements and credit_requirements in session and templates.
  • Frontend changes: introduce static/js/optional_courses.js and wire it up via main.js and program_handler.js to render an optional course shelf, allow adding/removing optional courses, and merge requirements from added programs; update static/js/data_init.js to respect include_in_graph and static/js/sheet_view.js to render requirement bucket progress and credit ranges.
  • UI and assets: add styles in static/css/style.css, add optional-shelf and requirement buckets UI to templates/graph.html, and inject programRequirements into the page JS context.

Testing

  • No automated tests were added or executed as part of this change.

Codex Task

an-andrey added 23 commits May 19, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant